home *** CD-ROM | disk | FTP | other *** search
-
- The Simplest Clock
- V1.56
- 9 Mar 1993
-
-
- Frantisek Dufka
- Hrusovska 9
- 701 00, Ostrava 1
- Czech Republic
-
- e-mail: dufkaf@risc.upol.cz
-
- This program is public domain. You can freely distribute it as long as you
- keep all the files unchanged. You are using it on your own risk.
-
- As I know this program works fine with OS V1.3/2.0/3.0, if you have problems
- with any OS version, send me an e-mail please.
-
- CLI USAGE:
-
- SimplestClock [[-[r][number]] RawDoSimplestClockFmtString]
-
- DESCRIPTION:
-
- This proggy lives in a small window on the top of any suitable Intuition
- screen and shows some important information (time and size of your free mem)
- in a way you specify by RawDoSimplestClockFmtString.
-
- Term "suitable Intuition screen" means usual Intuition screen with name and
- gadgets (without flag SCREENQUIET), which is wide enough for clock's window.
-
- Default command line options are :
-
- "-5 Chip:%B7ld Fast:%C7ld Time: %A02d:%02d:%02d"
-
- Let me explain that curious RawDoSimplestClockFmtString first please ...
-
- String is made up from C-style format string (printf etc.) with some special
- SimplestClock commands inserted just after '%' characters. Each command
- expresses number or numbers which are passed to evaluating routine. (function
- RawDoFmt from Exec library)
-
- SimplestClock commands currently supported :
-
- A (3 words) = system time (hours,minutes,seconds)
- B (1 long) = amount of free Chip memory in bytes
- C (1 long) = amount of free Fast memory
- D (1 long) = amount of free Public memory
- E (1 long) = size of largest free memory block
- F (1 long) = amount of free Chip memory in kilobytes
- G (1 long) = amount of free Fast memory
- H (1 long) = amount of free Public memory
- I (1 long) = size of largest free memory block
-
- If you don't know what 1 long, 3 words or C-style format string means read
- next paragraph otherwise skip it please.
-
- 1 long means that there must be %7ld substring in C-style format string
- (%7ld means long decimal number made of 7 characters) and 3 words means
- that there should be %02d substring for 3 times in format string (%02d means
- decimal number made of 2 characters, empty spaces are filled with zeroes).
-
- So if you have 2 MB of Chip RAM, no Fast RAM and you don't want to see
- current time (well, but in this case the name 'Simplest Clock' looks a bit
- strange isn't it ?) you could write for example
-
- SimplestClock I currently have %B8ld bytes of free Chip memory for you.
-
- Or If you don't care about every little free byte in your Amiga, but you want
- to know what's the time, and you are not going to waste all the place of your
- screen bar for it, you can type for example
-
- SimplestClock %F4ldK %A02d:%02d:02d
-
- There's no need to 'Run' it, it executes part of itself as a new process.
- You can quit it by choosing menuitem called .... eh I forgot it's name, but
- I think you'll find it.
-
- There's also menuitem called 'Always in the front' there. If you check it,
- the clock will try to live always on the front screen if it's possible. This
- is the only way how to move clock thru screens. Just turn it on, then select
- screen, and turn it off.
-
- But there's one little problem. Everytimes when the clock moves to another
- screen it tries to close its screen (except Workbench Screen). It is safe
- because in intuition library version>=36 function CloseScreen doesn't close
- the screen if there's any window attached to it. And it's easy to correct it
- in V34 (takes about 14 bytes). So when you quit your application with clock
- on it's screen, the screen will stay on until you move the clock to another
- screen. So far so good, but when somebody opens screen without any window and
- you bring clock to that screen and then to another, the screen will be closed.
- Well, and if somebody writes something to closed screen ......... CRASH!!!
- But it never happened to me yet. Because when somebody opens intuition-style
- screen it is usual to open also backdrop window on it, cause you can't attach
- menus and gadgets (except system ones) to the screen (screen hasn't any IDCMP
- port, so you can't wait for events).
-
- To avoid crashes menuitem 'Always ...' is automatically turned off, when
- Clock moves to screen without any window. You can disable it with command line
- option -r.
-
- Option -number means task priority of SimplestClock process. The number can
- range from 0 to 9 and exactly means task priority minus four, so -0 means
- task priority -4 and -9 means priority of 5.
-
- I hope you will find these bytes useful. Any ideas, suggestions, questions or
- donations are welcome.
-
- Frantisek Dufka
-
- P.S. Sorry for my english, but it's not my native language.
-